package vnreal.ZNEW;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactoryConfigurationError;
import org.w3c.dom.Document;

import vnreal.ToolKit;
import vnreal.io.ScenarioExporter;
import vnreal.io.ScenarioImporter;

public class Test {
	public Document doc;
	Document doc2;
	void getScenario() {
		if (ToolKit.getScenario().getNetworkStack() != null) {
			DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
			DocumentBuilder docBuilder;
			try {
				docBuilder = docFactory.newDocumentBuilder();
				doc = docBuilder.newDocument();
				doc = new ScenarioExporter().getDoc();
				
			} catch (ParserConfigurationException e1) {
				e1.printStackTrace();
			}
		}
		DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
		DocumentBuilder docBuilder;
		try {
			docBuilder = docFactory.newDocumentBuilder();
			doc2 = docBuilder.newDocument();
			
		} catch (ParserConfigurationException e1) {
			e1.printStackTrace();
		}
	}
	void setScenario() throws TransformerConfigurationException, TransformerException, TransformerFactoryConfigurationError {
		new ScenarioImporter(doc2).setNetworkStack();
	}
}
